//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "tyr_halo\fn_execute.sqf"
#include <tmf_constants.h>
#include <tmf_macros.h>

TRACE_1("Start",_this);
TMFPROFILERSTART;

private ["_vec"];

if (tyr_halo_savebackpack <= 0) then {
	player call tyr_halo_savebackpack;
};

if (!(vehicle player isKindOf "ParachuteBase") && (vehicle player != player)) then {
	player allowDamage false;
	_vec = vehicle player;
	player action ["EJECT", _vec];
	player spawn { sleep 10; _this allowDamage true; };
};
sleep 0.5;
if (vehicle player isKindOf "ParachuteBase") then {
	_vec = vehicle player;
	player action ["EJECT", _vec];
	deleteVehicle _vec;
};

[player, ((position player) select 2)] spawn bis_fnc_halo;
if (tyr_halo_savebackpack <= 0) then {
	player spawn tyr_halo_restorebackpack;
};

TRACE("End");
TMFPROFILERSTOP;